data class Student(var name:String, val age:Int) {
    private val hobby = "music"
    val subject:String
    var score = 0
    init {
        println("initializing student")
        subject = "math"
    }
    constructor(_name:String):this(_name,10) {
        score = 10
    }

    override fun toString(): String {
        return "Student(name='$name', age=$age, hobby='$hobby', subject='$subject')"
    }

}

fun main() {
    val s = Student("jack")
    //除名字以外，其他的属性都赋值过来。在次构造函数里面赋值属性不会复制过来
    val copy = s.copy("rose")

    println(s)
    println(copy)
}